#!/usr/bin/node

const argv = process.argv,
      log = console.log;

//validata argv
//校验的方面：
//1 argv number equal 3 空值
if(argv.length !=3){
  log('cmd exit-code');
  process.exit(1);
}
//code type is number,NaN数据类型
if(isNaN(Number(argv[2]))){
  log('argv must be number');
  process.exit(2);
}
//code range>0 取值范围
if(Number(argv[2]) <0){
  log('argv must >= 0');
  process.exit(3);
}
//模式


process.exit(argv[2]);
